#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_clicked()
{
    //设置窗口的样式
    this->setStyleSheet("background-color:rgb(240,240,240);");

    //设置输入框的样式
    ui->textEdit->setStyleSheet("background-color: white; color: balck;");

    //设置按钮的样式
    ui->pushButton->setStyleSheet("color: black;");
    ui->pushButton_2->setStyleSheet("color: black;");
}

void Widget::on_pushButton_2_clicked()
{
    //设置窗口的样式
    this->setStyleSheet("background-color:black;");

    //设置输入框的样式
    ui->textEdit->setStyleSheet("background-color: black; color: white;");

    //设置按钮的样式
    ui->pushButton->setStyleSheet("color: white;");
    ui->pushButton_2->setStyleSheet("color: white;");
}
